// 主界面
;
define(function(require, exports, module) {
	'use strict';
	var util = require("util");
	var base = require("base");
	var router = require("../hash/pageRouter");
	var dialog = require("dialog");
	var validate = require("validate");
	var databind = require("databind");
	var css_detail_info = require("./adjustCreditRecord.css");
	var constant = require("constant");
	var financeId;
	var pageIndex = 1,
		pageSize = 10,
		totalPageCount = 1,
		totalRecordCount = 0; //分页初始化
	var init = function(page) {
		financeId = page.params.financeId
		inquireFinanceCreditPageList();
		initEvent();
	};
	var initEvent = function() {
		//若未登录，则返回登陆页面
		if (base.getData("sid") == null || base.getData("sid") == "" || base.getData("sid") == undefined) {
			top.location.href = "../login/login.html";
		}

	};

	//查询授信调整记录
	var inquireFinanceCreditPageList = function() {
		base.fnAjax({
			action: "inquireFinanceCreditPageList.json",
			version: "v1.0",
			oData: {
				financeId: financeId,
				adjustment: 1
			}, //传递参数
			fnSuccess: function(data) { //成功回调
				if (data.status == 200) {
					var tpl = $("#creditReocrdTpl").html();
					var html = juicer(tpl, data);
					$("#creditReocrdTable").html(html);
					
					$(".recordLook").mouseover(function(){
						$(this).parent().find(".reocrdRmak").css("display", "block");
					});
					
					$(".recordLook").mouseleave(function(){
						$(this).parent().find(".reocrdRmak").css("display", "none");
					});
					
					if($("#creditReocrdTable tr").length == 1){
						$("#creditReocrdTable").html('<div>暂无估值调整记录！</div>');
					};
					
				} else {
					base.alert(3, data.message);
				}
			}
		});
	}
		//显示运输通知--货箱
	return {
		init: init
	};
});